<?php

/**
 * Concepto filter form base class.
 *
 * @package    sf_sandbox
 * @subpackage filter
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 29570 2010-05-21 14:49:47Z Kris.Wallsmith $
 */
abstract class BaseConceptoFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'nombre' => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'tipo'   => new sfWidgetFormChoice(array('choices' => array('' => '', 'FIJO' => 'FIJO', 'VARIABLE' => 'VARIABLE'))),
      'cuenta' => new sfWidgetFormChoice(array('choices' => array('' => '', 'CREDITO' => 'CREDITO', 'DEBITO' => 'DEBITO'))),
      'valor'  => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'activo' => new sfWidgetFormChoice(array('choices' => array('' => '', 'SI' => 'SI', 'NO' => 'NO'))),
      'codigo' => new sfWidgetFormFilterInput(array('with_empty' => false)),
    ));

    $this->setValidators(array(
      'nombre' => new sfValidatorPass(array('required' => false)),
      'tipo'   => new sfValidatorChoice(array('required' => false, 'choices' => array('FIJO' => 'FIJO', 'VARIABLE' => 'VARIABLE'))),
      'cuenta' => new sfValidatorChoice(array('required' => false, 'choices' => array('CREDITO' => 'CREDITO', 'DEBITO' => 'DEBITO'))),
      'valor'  => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'activo' => new sfValidatorChoice(array('required' => false, 'choices' => array('SI' => 'SI', 'NO' => 'NO'))),
      'codigo' => new sfValidatorPass(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('concepto_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'Concepto';
  }

  public function getFields()
  {
    return array(
      'id'     => 'Number',
      'nombre' => 'Text',
      'tipo'   => 'Enum',
      'cuenta' => 'Enum',
      'valor'  => 'Number',
      'activo' => 'Enum',
      'codigo' => 'Text',
    );
  }
}
